-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-46004: [C++][FlightRPC] Enable ODBC Build In C++ Workflows #47689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| #include <arrow/flight/types.h> | ||
| #include <boost/variant.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boost::variant is an existing dependency of flightsql-odbc. Our plan is to replace it with std::variant in future PRs
.github/workflows/ruby.yml
Outdated
| @@ -219,6 +219,7 @@ jobs: | |||
| ARROW_DATASET: ON | |||
| ARROW_FLIGHT: ON | |||
| ARROW_FLIGHT_SQL: ON | |||
| ARROW_FLIGHT_SQL_ODBC: ON | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARROW_FLIGHT_SQL_ODBC: ON is already on cpp.yml file
c1d79fa to
bb49757
Compare
ec39f37 to
4d254df
Compare
| switch (msg) { | ||
| case WM_NCCREATE: { | ||
| _ASSERT(lparam != NULL); | ||
| assert(lparam != NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use ARROW_DCHECK*() instead?
arrow/cpp/src/arrow/util/logging.h
Lines 90 to 125 in 5750e29
| # ifdef NDEBUG | |
| # define ARROW_DFATAL ::arrow::util::ArrowLogLevel::ARROW_WARNING | |
| // CAUTION: DCHECK_OK() always evaluates its argument, but other DCHECK*() macros | |
| // only do so in debug mode. | |
| # define ARROW_DCHECK(condition) \ | |
| while (false) ARROW_IGNORE_EXPR(condition); \ | |
| while (false) ::arrow::util::detail::NullLog() | |
| # define ARROW_DCHECK_OK(s) \ | |
| ARROW_IGNORE_EXPR(s); \ | |
| while (false) ::arrow::util::detail::NullLog() | |
| # define ARROW_DCHECK_EQ(val1, val2) \ | |
| while (false) ARROW_IGNORE_EXPR(val1); \ | |
| while (false) ARROW_IGNORE_EXPR(val2); \ | |
| while (false) ::arrow::util::detail::NullLog() | |
| # define ARROW_DCHECK_NE(val1, val2) \ | |
| while (false) ARROW_IGNORE_EXPR(val1); \ | |
| while (false) ARROW_IGNORE_EXPR(val2); \ | |
| while (false) ::arrow::util::detail::NullLog() | |
| # define ARROW_DCHECK_LE(val1, val2) \ | |
| while (false) ARROW_IGNORE_EXPR(val1); \ | |
| while (false) ARROW_IGNORE_EXPR(val2); \ | |
| while (false) ::arrow::util::detail::NullLog() | |
| # define ARROW_DCHECK_LT(val1, val2) \ | |
| while (false) ARROW_IGNORE_EXPR(val1); \ | |
| while (false) ARROW_IGNORE_EXPR(val2); \ | |
| while (false) ::arrow::util::detail::NullLog() | |
| # define ARROW_DCHECK_GE(val1, val2) \ | |
| while (false) ARROW_IGNORE_EXPR(val1); \ | |
| while (false) ARROW_IGNORE_EXPR(val2); \ | |
| while (false) ::arrow::util::detail::NullLog() | |
| # define ARROW_DCHECK_GT(val1, val2) \ | |
| while (false) ARROW_IGNORE_EXPR(val1); \ | |
| while (false) ARROW_IGNORE_EXPR(val2); \ | |
| while (false) ::arrow::util::detail::NullLog() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I have changed to use ARROW_DCHECK here.
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Arrow Flight SQL ODBC Driver" /v Setup /t REG_SZ /d %ODBC_AMD64% /f | ||
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" /v "Apache Arrow Flight SQL ODBC Driver" /t REG_SZ /d "Installed" /f | ||
|
|
||
| IF !ERRORLEVEL! NEQ 0 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| IF !ERRORLEVEL! NEQ 0 ( | |
| if !ERRORLEVEL! NEQ 0 ( |
BTW, is !ERRORLEVEL! still non 0 when the first reg add succeeded and the last reg add failed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!ERRORLEVEL! should be reflecting on the last command executed, so yes !ERRORLEVEL! should be non zero if last reg add failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need _amd64 in file name?
It seems that this doesn't have any amd64 specific part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea that's fair, I have renamed to install_odbc
.github/workflows/cpp.yml
Outdated
| - name: Register Flight SQL ODBC Driver | ||
| shell: cmd | ||
| run: | | ||
| call "cpp\src\arrow\flight\sql\odbc\install\install_amd64.cmd" ${{github.workspace}}\build\cpp\%ARROW_BUILD_TYPE%\libarrow_flight_sql_odbc.dll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpp\src\arrow\flight\sql\odbc\script\ not ...\install\ may be better.
We will add uninstall scripts later, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I have renamed to script folder.
I am not sure if uninstall scripts are needed in this scenario and I am open to discussion. This script is for testing only. ODBC users will be able to install and uninstall the ODBC driver using a msi executable, so they won't need to use the script to install or uninstall the driver. Developers can also manually delete the driver registry if needed. This script can also be run a second time to change the registry to point to a different ODBC dll location, so the driver registry usually doesn't need to be deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Then how about using test\ directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or ci\scripts\?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have renamed to tests. I think tests directory would work better in this case compared to ci\scripts since this is the only script for testing.
| #include "arrow/flight/sql/odbc/odbc_impl/platform.h" | ||
|
|
||
| #include <sys/types.h> | ||
| #include <cstdint> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this missing previously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so. I recall it was causing build issues on workflows. The build works with or without this header on my local machine (Windows MSVC), but the CI builds can have problems without the header
|
I think the failed |
|
(FWIW, Kou/Raul are probably busy getting the new release out) |
032cb79 to
c880d47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems you have pushed a change to the testing submodule reverting it back to the previous commit, can you update the submodule to point again to the latest commit?
Current commit should be:
apache/arrow-testing@9a02925
|
Thanks a lot for the PR, CI seems to be fixed now :) |
c880d47 to
8d79a82
Compare
Good catch, I have fixed it and reverted the testing submodule change. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
5dce6e2 to
e39d05b
Compare
…on (#47759) ### Rationale for this change ODBC driver needs to handle environment handle and connection handle allocation and deallocation. ### What changes are included in this PR? - Implement SQLAllocHandle and SQLFreeHandle APIs for allocating and deallocating environment and connection handles. - Tests ### Are these changes tested? - Tested locally on Windows MSVC. - Will be tested in CI after #47689 is merged ### Are there any user-facing changes? No * GitHub Issue: #46096 * GitHub Issue: #46097 Authored-by: Alina (Xi) Li <[email protected]> Signed-off-by: David Li <[email protected]>
e39d05b to
4788fd9
Compare
…#47760) ### Rationale for this change ODBC driver needs to set and get environment attributes, such as ODBC driver version. ### What changes are included in this PR? - Implement SQLGetEnvAttr and SQLSetEnvAttr APIs for retrieving and setting environment attribute values - Tests ### Are these changes tested? Tested locally on Windows MSVC. Will be tested in CI after #47689 is merged ### Are there any user-facing changes? No * GitHub Issue: #46098 Lead-authored-by: Alina (Xi) Li <[email protected]> Co-authored-by: rscales <[email protected]> Signed-off-by: David Li <[email protected]>
Enable ODBC build in Windows MSVC workflow Fix build issue Register ODBC driver ODBC driver registration is required for ODBC tests (enabled in a separate PR) Address Sutou's comments
4788fd9 to
b304699
Compare
|
@kou Please let me know if you have any other comments, thanks! I would like to get this PR merged if possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 6a08785. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 9 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
Enable ODBC Build In C++ Workflows to make sure ODBC can build in CI.
What changes are included in this PR?
ARROW_FLIGHT_SQL_ODBC:ONrecognized in C++ build.Are these changes tested?
Tested in CI
Are there any user-facing changes?
No
Extracted from PR #46099